package cn.itlaobing.service.advice;

import java.lang.reflect.Method;
import java.util.Arrays;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.aop.MethodBeforeAdvice;

public class LoggerAdvice implements MethodBeforeAdvice {

	Log log=LogFactory.getLog(LoggerAdvice.class);
	/**
	 * method 被拦截的方法
	 * args 方法的参数值
	 * target 目标代理对象
	 */
	@Override
	public void before(Method method, Object[] args, Object target) throws Throwable {
		log.info(String.format("被调用的方法：%s , 参数： %s  目标对象: %s", 
				method.getName(),Arrays.toString(args),target.getClass().getName()));
		
	}


}
